package com.atde._04_structural_design_patterns.decorator;


import java.awt.image.DirectColorModel;

/**
 * @BelongsProject: hsp_java_design_mode
 * @BelongsPackage: com.atde._04_structural_design_patterns.decorator
 * @Author: Del
 * @CreateTime: 2025-06-20  15:20
 * @Description: 装饰器模式 --- 测试类
 * @Version: 1.0
 */
public class CofferBar {
    public static void main(String[] args) {
        // 装饰者模式下的订单：2份巧克力 + 一份牛奶的 LongBlack
        // 1. 先来一份 LongBlack
        Drink order = new LongBlack();
        System.out.println("订单：" + order.getDes());
        // 2. order 添加一份牛奶
        order = new Milk(order);
        System.out.println("订单：" + order.getDes());
        // 3. order 添加一份巧克力
        order = new Chocolate(order);
        System.out.println("订单：" + order.getDes());
        // 3. order 再次添加一份巧克力
        order = new Chocolate(order);
        System.out.println("订单：" + order.getDes());
    }
}
